#include "common.h"

/**
 * Print error message to stderr and exit with exit_code.
 */
void error_exit(int exit_code, const char *msg, char *extra)
{
    fprintf(stderr, "ERROR: ");
    if(NULL == extra)
        fprintf(stderr, msg);
    else
        fprintf(stderr, msg, extra);
    fputc('\n', stderr);
    exit(exit_code);
}

